//
// Created by luolijun on 2021/10/31.
//

#ifndef FACADEITEM_H
#define FACADEITEM_H

#include "falcon/facade.h"
#include "falcon/ui.h"

#include "FacadePainterImpl.h"

#include <QGraphicsItem>
#include <QObject>

namespace falcon {

class FacadeItem : public QObject, public QGraphicsItem {
    Q_OBJECT
    Q_INTERFACES(QGraphicsItem)

public:
    FacadeItem(falcon::Facade* f);

public: //  QGraphicsItem
    virtual QRectF boundingRect() const override;
    virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;

public:
    void move(const falcon::POINT& pos);

private:
    falcon::Facade* facade;
    falcon::FacadePainterImpl painter;
    QRectF rect;
};

} // namespace falcon
#endif // FACADEITEM_H
